/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @file SpiSlave_PbCfg.c
 * @brief AutoSAR SPI configuration header file
 * @details Automatically generated by user settings
 * @date 2025-03-25 19:03:22
 */

/*******************************************************************************
**                      Include Section                                       **
*******************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif

#include "Mcal.h"
#include "regs_base.h"
#include "SpiSlave_Types.h"
#include "Std_Types.h"
#include "SpiSlave_Cfg.h"
#include "SpiSlave_Ip.h"
/*******************************************************************************
**                      Version Information                                   **
*******************************************************************************/
/*PRQA S 1751  EOF*/
/* AUTOSAR specification version information */
#define SPI_SLV_PBCFG_C_AR_RELEASE_MAJOR_VERSION  4U
#define SPI_SLV_PBCFG_C_AR_RELEASE_MINOR_VERSION  3U
#define SPI_SLV_PBCFG_C_AR_RELEASE_REVISION_VERSION  1U

/*******************************************************************************
**                      Version Check                                         **
*******************************************************************************/


#if (SPI_SLV_AR_RELEASE_MAJOR_VERSION_VALUE != \
         SPI_SLV_PBCFG_C_AR_RELEASE_MAJOR_VERSION)
  #error "SpiSlave_PBcfg.c : Mismatch in Release Major Version"
#endif

#if (SPI_SLV_AR_RELEASE_MINOR_VERSION_VALUE != \
         SPI_SLV_PBCFG_C_AR_RELEASE_MINOR_VERSION)
  #error "SpiSlave_PBcfg.c : Mismatch in Release Minor Version"
#endif

#if (SPI_SLV_AR_RELEASE_REVISION_VERSION_VALUE != \
         SPI_SLV_PBCFG_C_AR_RELEASE_REVISION_VERSION)
  #error "SpiSlave_PBcfg.c : Mismatch in Release Revision Version"
#endif

/* SpiSlave_ UserCallback HeaderFile include */

/*******************************************************************************
**                      Global Data                                           **
*******************************************************************************/
#if (SPI_SLV_NO_CACHEABLE_NEEDED == STD_ON)
#define SPI_SLV_START_SEC_VAR_NO_INIT_NO_CACHE_UNSPECIFIED
#else
#define SPI_SLV_START_SEC_VAR_NO_INIT_UNSPECIFIED
#endif
#include "SpiSlave_MemMap.h"

    
        /* Global array for internal write buffers */
VAR_ALIGN(uint8 SpiSlave_IBWriteBuffer_SpiSlaveChannel_0[ROUNDUP(SPI_SLV_BUFFER_SIZE_CHANNEL_0,SPI_SLV_BUFF_SIZE_ROUNDUP_LEN)],SPI_SLV_BUFF_ALIGN_LEN);
/* Global array for internal read buffers */


#if (SPI_SLV_NO_CACHEABLE_NEEDED == STD_ON)
#define SPI_SLV_STOP_SEC_VAR_NO_INIT_NO_CACHE_UNSPECIFIED
#else
#define SPI_SLV_STOP_SEC_VAR_NO_INIT_UNSPECIFIED
#endif
#include "SpiSlave_MemMap.h"

#define SPI_SLV_START_SEC_CONST_UNSPECIFIED
#include "SpiSlave_MemMap.h"

/* This array contains configuration details for Channels */
CONST(SpiSlave_ChannelCfgType, SPI_SLV_CONST) SpiSlave_ChannelConfig[SPI_SLV_TOTAL_CH_COUNT] =
{
  /* Index: 0 - SpiSlaveChannel_0 */
  {
    /* ChannelBufferType */
    SPI_SLV_EB,
    /* TxDataWidth */
    8U,
    /* BufferSize */
    SPI_SLV_BUFFER_SIZE_CHANNEL_0,
    /* WriteBufferIndex */
    (SpiSlave_DataBufferType*)SpiSlave_IBWriteBuffer_SpiSlaveChannel_0,
    /* ReadBufferIndex */
    NULL_PTR,
    /* TransferType */
    SPI_SLV_MSB,
    /* DefaultValue */
    0xFFU,
  }    
};

/* Channel list */
static CONST(SpiSlave_ChannelType, SPI_SLV_CONST) SpiSlaveJob_0_ChannelList [1]=
{
    /* Linked channels for job: 0  */
    0U,
};
/*
  This array contains configuration details for Jobs.
  And sorted by Job priority
*/






CONST(SpiSlave_JobCfgType, SPI_SLV_CONST) SpiSlave_JobConfig[SPI_SLV_TOTAL_JOB_COUNT] =
{
    /* Index: 0 - SpiSlaveJob_0 */
  {
    /* DataWith */
    8,
    /* BitOrder */
    SPI_SLV_MSB,
    /* Device Idx */
    0,
    /*HwUnitIdxCfg*/
    0U,
    /* HWUnit */
    SPI_SLV_CSIB6,
    /* CSPin */
    SPI_SLV_CS_0,
    /* EnableRx */
    TRUE,
    /* CSPolarity */
    SPI_SLV_LOW,
    /* ShiftClk */
    SPI_SLV_HIGH,
    /* ShiftEdge */
    SPI_SLV_LEADING,
    /* config the parity of transmission */
    SPI_SLV_P_EVEN,
    /* Priority */
    0U,
    /* JobEndNotification */
    NULL_PTR,
    /* LE swap to BE  */
    FALSE,
    /* timeout */
    31,
    /* BaudRateCheckMax */
    255,
    /* BaudRateCheckMin */
    0,
    /* NoOfChannels */
    1U,
    /* ChannelList */
    SpiSlaveJob_0_ChannelList,
  },
};

/* Job list */

static CONST(SpiSlave_JobType, SPI_SLV_CONST) SpiSlaveSequence_0_JobList [1]=
{
    /*
      Linked Job for Sequence: 0
      and sorted by Job priority.
    */
    0U ,  
};






/* This array contains configuration details for Sequences */
CONST(SpiSlave_SequenceCfgType, SPI_SLV_CONST) SpiSlave_SequenceConfig[SPI_SLV_TOTAL_SEQ_COUNT] =
{
  /* Index: 0 - SpiSlaveSequence_0 */
  {
    /* InterruptableSequence */
    FALSE,
    /* SequenceEndNotification */
    NULL_PTR,
    /* NoOfJobs */
    1U,
    /* JobList */
    SpiSlaveSequence_0_JobList,
    /* Jobs HwMask */
    0x1 << SPI_SLV_CSIB6
  },

};

/* Hw list */
/* This array contains HwUnit property */
CONST(SpiSlave_HwUnitConfigType, SPI_SLV_CONST) SpiSlave_HwUnitConfig[SPI_SLV_TOTAL_HW_COUNT] =
{
  
  /* SpiSlaveHwUnit_0 */
  {
    .HwUnit = SPI_SLV_CSIB6,
    /* DMA mode Enable */
    .HwDMA = (boolean)FALSE,
    /* controler base */
    .ctrlRegBase = APB_SPI6_BASE,
  }
};


CONST(uint32, SPI_SLV_CONST) SpiSlave_InstanceMask_Config[5] =
{
  
0x1 << SPI_SLV_CSIB6 | 0,0,0,0,0

};
/* Structure for SPI Init configuration */
CONST(SpiSlave_ConfigType, SPI_SLV_CONST) SpiSlave_Config[SPI_SLV_TOTAL_DRIVERS] =
{
  /* Index: 0 - SpiSlaveDriver */
  {
    /* ChannelType */
    SpiSlave_ChannelConfig,
    /* JobType */
    SpiSlave_JobConfig,
    /* SequenceType */
    SpiSlave_SequenceConfig

  }
};

#define SPI_SLV_STOP_SEC_CONST_UNSPECIFIED
#include "SpiSlave_MemMap.h"

#ifdef __cplusplus
}
#endif
/*******************************************************************************
**                          End of File                                       **
*******************************************************************************/

